#!usr/bin/env python  
# -*- coding:utf-8 _*-
""" 
@author:robot
@file: connector_print.py 
@version:
@time: 2022/06/01 
"""
import os


def common_print():
    print('')
    print('Hi, you can use this command')
    print('')


class ConnectorPrint:
    @staticmethod
    def exec(cmd):
        print(cmd)
        return os.system(cmd)

    @staticmethod
    def connector_help1():
        common_print()
        print('show_db_type')
        print('use Mysql|...')
        print('')

    @staticmethod
    def connector_help2():
        common_print()
        print('show_member')
        print('use member_name|...')
        print('')

    @staticmethod
    def connector_help3():
        common_print()
        print('show_dbs')
        print('show_tables')
        print('show_tables_count')
        print('show_attr')
        print('db.query(sql)')
        print('db.exec(sql)')
        print('use table')
        print('')

    @staticmethod
    def connector_help4():
        common_print()
        print('common_query')
        print('common_count')
        print('common_drop')
        print('')

    @staticmethod
    def back():
        print('返回上一层: back')

    @staticmethod
    def use_replace(command):
        if 'use ' in command:
            command = command.replace('use ', '')
            command = command.replace(' ', '')
        return command
